#include "YGEntity.h"

#include "YGSprite.h"

namespace YoghurtGum
{

	Entity::Entity() : Object()
	{
		m_Depth = 0.f;
	}	

	Entity::Entity(float a_X, float a_Y, float a_Depth)  : Object()
	{
		m_X = a_X;
		m_Y = a_Y;
		m_Depth = a_Depth;
	}

	Entity::~Entity()
	{

	}

	bool Entity::Collide( Vec2 a_Point )
	{
		return (
			a_Point.x >= m_X && a_Point.x <= m_X + m_Sprite->GetWidth() &&
			a_Point.y >= m_Y && a_Point.y <= m_Y + m_Sprite->GetHeight()
		);
	}

	void Entity::Render()
	{
		if (m_Sprite) 
		{
			m_Sprite->Draw(m_X, m_Y); 
		}
	}

	void Entity::Update()
	{

	}

	void Entity::PostRender()
	{

	}

	float Entity::GetDepth() const
	{
		return m_Depth;
	}

	void Entity::SetDepth(float a_Value)
	{
		m_Depth = a_Value;
	}

	void Entity::SetSprite(Sprite* a_Sprite)
	{
		m_Sprite = a_Sprite;
	}

	Sprite* Entity::GetSprite()
	{
		return m_Sprite;
	}

}; // namespace YoghurtGum